﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;


using Entity = SoTaiChinh.Library.Entity;
using Business = SoTaiChinh.Library.Business;

public partial class templates_client_usercontrols_slideshow_news : System.Web.UI.UserControl
{
    DataTable dsThongBao = new DataTable();    
    Entity.TinTuc entityThongBao = new Entity.TinTuc();
    Business.TinTuc businessThongBao = new Business.TinTuc();

    DataTable dsVanBanMoi = new DataTable();
    Entity.TinTuc entityVanBanMoi = new Entity.TinTuc();
    Business.TinTuc businessVanBanMoi = new Business.TinTuc();

    DataTable dsTinNoiBat = new DataTable();
    Entity.TinTuc entityTinNoiBat = new Entity.TinTuc();
    Business.TinTuc businessTinNoiBat = new Business.TinTuc();

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadThongBao();
            LoadVanBanMoi();
            LoadTinNoiBat();
        }
    }
    protected void LoadThongBao()
    {
        try
        {
            entityThongBao.ChuyenMuc = 61;
            dsThongBao = businessThongBao.SelectByDanhMucTop10(entityThongBao);
            rptThongBao.DataSource = dsThongBao;
            rptThongBao.DataBind();
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
    protected void LoadVanBanMoi()
    {
        try
        {
            entityVanBanMoi.ChuyenMuc = 17;
            dsVanBanMoi = businessVanBanMoi.SelectByDanhMucTop10(entityVanBanMoi);
            rptVanBanMoi.DataSource = dsVanBanMoi;
            rptVanBanMoi.DataBind();
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
    //Load tin noi bat
    protected void LoadTinNoiBat()
    {
        try
        {
            dsTinNoiBat = businessTinNoiBat.SelectTinNoiBat();
            rptTabTieuDe.DataSource = dsTinNoiBat;
            rptTabTieuDe.DataBind();
            rptContentTinNoiBat.DataSource = dsTinNoiBat;
            rptContentTinNoiBat.DataBind();
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
}
